<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>课程管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        form {
            margin: 20px;
            padding: 10px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }

        input[type="text"], input[type="submit"] {
            padding: 8px;
            margin: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        input[type="submit"] {
            background-color: #5cb85c;
            color: white;
            cursor: pointer;
        }

        table.tbStudent {
            width: 100%;
            max-width: 1200px;
            margin: 20px auto;
            border-collapse: collapse;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            background-color: #fff;
            border-radius: 8px;
            overflow: hidden;
        }

        .tbStudent th, .tbStudent td {
            padding: 12px 15px;
            text-align: left;
        }

        .tbStudent th {
            background-color: #2c3e50;
            color: white;
        }

        .tbStudent tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        .tbStudent tr:hover {
            background-color: #f1f7ff;
            transition: background-color 0.3s ease;
        }

        .tbStudent a {
            display: inline-block;
            padding: 6px 12px;
            margin: 2px;
            border: none;
            border-radius: 4px;
            text-decoration: none;
            color: #fff;
            background-color: #3498db;
            transition: background-color 0.3s ease;
        }

        .tbStudent a:hover {
            background-color: #2980b9;
        }

        .tbStudent a.delete {
            background-color: #e74c3c;
        }

        .tbStudent a.delete:hover {
            background-color: #c0392b;
        }
    </style>
</head>
<body>

<form action="tbStudent" method="get">
    <input type="text" name="courseName" placeholder="请输入名称">
    <input type="submit" value="查询">
</form>

<table class="tbStudent">
    <thead>
    <tr>
        <th>编号</th>
        <th>课程姓名</th>
        <th>课程人数</th>
        <th>开课时间</th>
        <th>结课时间</th>
        <th>讲师</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${courseList}" var="all">
        <tr>
            <td>${all.id}</td>
            <td>${all.name}</td>
            <td>${all.count}</td>
            <td>${all.startDate}</td>
            <td>${all.endDate}</td>
            <td>${all.teacher}</td>
            <td>
                <a href="tbStudentById?id=${all.id}">编辑</a>
                <a href="tbById?id=${all.id}" onclick="return confirm('确定要删除吗？')" class="delete">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="7" style="text-align:center;"><a href="tianjia.jsp">添加课程</a></td>
    </tr>
    </tbody>
</table>

</body>
</html>

